package com.example.demo.dao;
/* @Author      zouzh
 * @PackageName BlogSystem-sm
 * @Package     com.example.demo.dao
 * @Date        2023/9/6 10:08
 */

import com.example.demo.model.UserInfo;
import com.example.demo.model.vo.UserinfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    @Insert("insert into user(username, password) values (#{username}, #{password})")
    int reg(UserInfo userInfo);

    @Select("select * from user where username = #{username}")
    UserInfo getUserByName(@Param("username") String username);

    @Select("select * from user where id = #{uid}")
    UserinfoVO getUserByid(@Param("uid") int uid);
}
